import {getCategoryList,getBannerList} from '@/api'
const state={
    categoryList:[],
    bannerList:[],
    // floorList:[]
}
const actions={
    //获取三级联动数据
    async categoryList({commit}){
        let result =await getCategoryList();
        // console.log(result);
        if (result.code===200) {
            commit('CATEGORYLIST',result.data);           
        }
    },
    //获取banner数据
    async getBannerList({commit}){
        let result=await getBannerList();
        console.log(result);
        if (result.code===200) {
            commit('BANNERYLIST',result.data);   
        }
    }
}
const mutations={
    CATEGORYLIST(state,categoryList){
        state.categoryList=categoryList;
    },
    BANNERYLIST(state,bannerList){
        state.bannerList=bannerList;
    }
}
const getters={}

export default {
    state,actions,mutations,getters
}